package com.lzw.bluetoothpractice.Activitys;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.lzw.bluetoothpractice.AAChartCoreLib.AAChartCreator.AAChartModel;
import com.lzw.bluetoothpractice.AAChartCoreLib.AAChartCreator.AAChartView;
import com.lzw.bluetoothpractice.AAChartCoreLib.AAChartCreator.AASeriesElement;
import com.lzw.bluetoothpractice.AAChartCoreLib.AAChartEnum.AAChartType;
import com.lzw.bluetoothpractice.AAChartCoreLib.AAChartEnum.AAChartZoomType;
import com.lzw.bluetoothpractice.AAChartCoreLib.AAOptionsModel.AAScrollablePlotArea;
import com.lzw.bluetoothpractice.R;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

public class zhexianActivity extends BaseActivity {
    private AAChartView aaChartView;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zhexian);
        aaChartView = findViewById(R.id.AAChartView);
        InitView();
    }

    AAChartModel configureArearangeChart() {
        return new AAChartModel()
                .chartType(AAChartType.Arearange)
                .title("Twilight Hall day temperature fluctuation map")
                .subtitle("real-time monitoring data")
                .yAxisTitle("℃")
                .series(new AASeriesElement[]{
                        new AASeriesElement()
                                .name("2020")
                                .data(new Object[][] {
                                /* 2014-01-01 */
                                {138853800, 1.1,  4.7},
                                {138862440, 1.8,  6.4},
                                {138871080, 1.7,  6.9},
                                {138879720, 2.6,  7.4},
                                {138888360, 3.3,  9.3},
                                {138897000, 3.0,  7.9},
                                {138905640, 3.9,  6.0},
                                {138914280, 3.9,  5.5},
                                {138922920, -0.6, 4.5},
                                {138931560, -0.5, 5.3},
                                {138940200, -0.3, 2.4},
                                {138948840, -6.5,-0.4},
                                {138957480, -7.3,-3.4},
                                {138966120, -7.3,-2.3},
                                {138974760, -7.9,-4.2},
                                {138983400, -4.7, 0.9},
                                {138992040, -1.2, 0.4},
                                {139000680, -2.3,-0.1},
                                {139009320, -2.0, 0.3},
                                {139017960, -5.1,-2.0},
                                {139026600, -4.4,-0.5},
                                {139035240, -6.4,-2.7},
                                {139043880, -3.2,-0.5},
                                {139052520, -5.5,-0.8},
                                {139061160, -4.4, 2.4},
                                {139069800, -4.0, 1.1},
                                {139078440, -3.4, 0.8},
                                {139087080, -1.7, 2.6},
                                {139095720, -3.1, 3.9},
                                {139104360, -8,  -1.9},
                                {139113000, -7,  -2.8},
                                /* 2014-02-01 */
                                {139121640, -2.7, 2.6},
                                {139130280, -1.3, 8.2},
                                {139138920, 1.5,  7.7},
                                {139147560, -0.5, 5.3},
                                {139156200, -0.2, 5.2},
                                {139164840, 0.7,  4.8},
                                {139173480, 0.9,  5.7},
                                {139182120, 1.7,  3.9},
                                {139190760, 2.2,  8.8},
                                {139199400, 3.0,  6.6},
                                {139208040, 1.4,  5.4},
                                {139216680, 0.6,  5.1},
                                {139225320, 0.1,  7.8},
                                {139233960, 3.4,  7.3},
                                {139242600, 2.0,  5.9},
                                {139251240, 1.1,  4.7},
                                {139259880, 1.1,  4.4},
                                {139268520, -2.8, 2.6},
                                {139277160, -5.0, 0.1},
                                {139285800, -5.7, 0.2},
                                {139294440, -0.7, 3.9},
                                {139303080, 1.5,  7.8},
                                {139311720, 5.5,  8.8},
                                {139320360, 5.3, 11.7},
                                {139329000, 1.7, 11.1},
                                {139337640, 3.4,  9.3},
                                {139346280, 3.4,  7.3},
                                {139354920, 4.5,  8.0},
                                /* 2014-03-01 */
                                {139363560, 2.1,  8.9},
                                {139372200, 0.6,  6.1},
                                {139380840, 1.2,  9.4},
                                {139389480, 2.6,  7.3},
                                {139398120, 3.9,  9.5},
                                {139406760, 5.3,  9.9},
                                {139415400, 2.7,  7.1},
                                {139424040, 4.0,  8.6},
                                {139432680, 6.1, 10.7},
                                {139441320, 4.2,  7.6},
                                {139449960, 2.5,  9.0},
                                {139458600, 0.2,  7.0},
                                {139467240, -1.2, 6.9},
                                {139475880, 0.4,  6.7},
                                {139484520, 0.2,  5.1},
                                {139493160, -0.1, 6.0},
                                {139501800, 1.0,  5.6},
                                {139510440, -1.1, 6.3},
                                {139519080, -1.9, 0.3},
                                {139527720, 0.3,  4.5},
                                {139536360, 2.4,  6.7},
                                {139545000, 3.2,  9.2},
                                {139553640, 1.7,  3.6},
                                {139562280, -0.3, 7.9},
                                {139570920, -2.4, 8.6},
                                {139579560, -1.7,10.3},
                                {139588200, 4.1, 10.0},
                                {139596840, 4.4, 14.0},
                                {139605480, 3.3, 11.0},
                                {139614120, 3.0, 12.5},
                                {139622400, 1.4, 10.4},
                                /* 2014-04-01 */
                                {139631040, -1.2, 8.8},
                                {139639680, 2.2,  7.6},
                                {139648320, -1.0,10.1},
                                {139656960, -1.8, 9.5},
                                {139665600, 0.2,  7.7},
                                {139674240, 3.7,  6.4},
                                {139682880, 5.8, 11.4},
                                {139691520, 5.4,  8.7},
                                {139700160, 4.5, 12.2},
                                {139708800, 3.9,  8.4},
                                {139717440, 4.5,  8.0},
                                {139726080, 6.6,  8.4},
                                {139734720, 3.7,  7.3},
                                {139743360, 3.6,  6.7},
                                {139752000, 3.5,  8.3},
                                {139760640, 1.5, 10.2},
                                {139769280, 4.9,  9.4},
                                {139777920, 3.5, 12.0},
                                {139786560, 1.5, 13.1},
                                {139795200, 1.7, 15.6},
                                {139803840, 1.4, 16.0},
                                {139812480, 3.0, 18.4},
                                {139821120, 5.6, 18.8},
                                {139829760, 5.7, 17.2},
                                {139838400, 4.5, 16.4},
                                {139847040, 3.1, 17.6},
                                {139855680, 4.7, 18.9},
                                {139864320, 4.9, 16.6},
                                {139872960, 6.8, 15.6},
                                {139881600, 2.8,  9.2},
                                /* 2014-05-01 */
                                {139890240, -2.7,10.5},
                                {139898880, -1.9,10.9},
                                {139907520, 4.5,  8.5},
                                {139916160, -0.6,10.4},
                                {139924800, 4.0,  9.7},
                                {139933440, 5.5,  9.5},
                                {139942080, 6.5, 13.2},
                                {139950720, 3.2, 14.5},
                                {139959360, 2.1, 13.5},
                                {139968000, 6.5, 15.6},
                                {139976640, 5.7, 16.2},
                                {139985280, 6.3, 15.3},
                                {139993920, 5.3, 15.3},
                                {140002560, 6.0, 14.1},
                                {140011200, 1.9,  7.7},
                                {140019840, 7.2,  9.8},
                                {140028480, 8.9, 15.2},
                                {140037120, 9.1, 20.5},
                                {140045760, 8.4, 17.9},
                                {140054400, 6.8, 21.5},
                                {140063040, 7.6, 14.1},
                                {140071680, 11.1,16.5},
                                {140080320, 9.3, 14.3},
                                {140088960, 10.4,19.3},
                                {140097600, 5.7, 19.4},
                                {140106240, 7.9, 17.9},
                                {140114880, 5.0, 22.5},
                                {140123520, 7.6, 22.0},
                                {140132160, 5.7, 21.9},
                                {140140800, 4.6, 20.0},
                                {140149440, 7.0, 22.0},
                                /* 2014-06-01 */
                                {140158080, 5.1, 20.6},
                                {140166720, 6.6, 24.6},
                                {140175360, 9.7, 22.2},
                                {140184000, 9.6, 21.6},
                                {140192640, 13.0,20.0},
                                {140201280, 12.9,18.2},
                                {140209920, 8.5, 23.2},
                                {140218560, 9.2, 21.4},
                                {140227200, 10.5,22.0},
                                {140235840, 7.3, 23.4},
                                {140244480, 12.1,18.2},
                                {140253120, 11.1,13.3},
                                {140261760, 10.0,20.7},
                                {140270400, 5.8, 23.4},
                                {140279040, 7.4, 20.1},
                                {140287680, 10.3,21.9},
                                {140296320, 7.8, 16.8},
                                {140304960, 11.6,19.7},
                                {140313600, 9.8, 16.0},
                                {140322240, 10.7,14.4},
                                {140330880, 9.0, 15.5},
                                {140339520, 5.1, 13.3},
                                {140348160, 10.0,19.3},
                                {140356800, 5.2, 22.1},
                                {140365440, 6.3, 21.3},
                                {140374080, 5.5, 21.1},
                                {140382720, 8.4, 19.7},
                                {140391360, 7.1, 23.3},
                                {140400000, 6.1, 20.8},
                                {140408640, 8.4, 22.6},
                                /* 2014-07-01 */
                                {140417280, 7.6, 23.3},
                                {140425920, 8.1, 21.5},
                                {140434560, 11.2,18.1},
                                {140443200, 6.4, 14.9},
                                {140451840, 12.7,23.1},
                                {140460480, 15.3,21.7},
                                {140469120, 15.1,19.4},
                                {140477760, 10.8,22.8},
                                {140486400, 15.8,29.7},
                                {140495040, 15.8,29.0},
                                {140503680, 15.2,30.5},
                                {140512320, 14.9,28.1},
                                {140520960, 13.1,27.4},
                                {140529600, 15.5,23.5},
                                {140538240, 14.7,20.1},
                                {140546880, 14.4,16.8},
                                {140555520, 12.6,18.5},
                                {140564160, 13.9,24.4},
                                {140572800, 11.3,26.9},
                                {140581440, 13.3,27.4},
                                {140590080, 13.3,29.7},
                                {140598720, 14.0,28.8},
                                {140607360, 14.1,29.8},
                                {140616000, 15.4,31.1},
                                {140624640, 17.0,26.5},
                                {140633280, 16.6,27.1},
                                {140641920, 13.3,25.6},
                                {140650560, 16.8,21.9},
                                {140659200, 16.0,22.8},
                                {140667840, 14.4,19.0},
                                {140676480, 12.8,18.1},
                                /* 2014-08-01 */
                                {140685120, 12.6,18.0},
                                {140693760, 11.4,19.7},
                                {140702400, 13.9,18.9},
                                {140711040, 12.5,19.9},
                                {140719680, 12.3,23.4},
                                {140728320, 12.8,23.3},
                                {140736960, 11.0,20.4},
                                {140745600, 14.7,22.4},
                                {140754240, 11.1,23.6},
                                {140762880, 13.5,20.7},
                                {140771520, 13.7,23.1},
                                {140780160, 12.8,19.6},
                                {140788800, 12.1,18.7},
                                {140797440, 8.8, 22.4},
                                {140806080, 8.2, 20.1},
                                {140814720, 10.9,16.3},
                                {140823360, 10.7,16.1},
                                {140832000, 11.0,18.9},
                                {140840640, 12.1,14.7},
                                {140849280, 11.2,14.4},
                                {140857920, 9.9, 16.6},
                                {140866560, 6.9, 15.7},
                                {140875200, 8.9, 15.3},
                                {140883840, 8.2, 17.6},
                                {140892480, 8.4, 19.5},
                                {140901120, 6.6, 19.9},
                                {140909760, 6.4, 19.7},
                                {140918400, 0,      0},
                                {140927040, 0,      0},
                                {140935680, 0,      0},
                                {140944320, 0,      0},
                                /* 2014-09-01 */
                                {140952960, 0,      0},
                                {140961600, 0,      0},
                                {140970240, 0,      0},
                                {140978880, 0,      0},
                                {140987520, 0,      0},
                                {140996160, 13.4,13.4},
                                {141004800, 13.2,17.1},
                                {141013440, 11.9,18.9},
                                {141022080, 9.0, 15.9},
                                {141030720, 5.9, 17.5},
                                {141039360, 6.8, 16.2},
                                {141048000, 10.3,19.9},
                                {141056640, 8.7, 17.9},
                                {141065280, 7.9, 19.1},
                                {141073920, 6.0, 20.1},
                                {141082560, 4.7, 19.9},
                                {141091200, 4.0, 18.8},
                                {141099840, 4.5, 17.9},
                                {141108480, 3.1, 16.1},
                                {141117120, 8.5, 12.2},
                                {141125760, 7.6, 13.8},
                                {141134400, 1.3, 12.6},
                                {141143040, 2.0, 10.9},
                                {141151680, 5.0, 10.8},
                                {141160320, 6.4, 10.1},
                                {141168960, 8.2, 13.3},
                                {141177600, 8.9, 11.8},
                                {141186240, 9.9, 15.9},
                                {141194880, 5.2, 12.5},
                                {141203520, 4.6, 11.7},
                                /* 2014-10-01 */
                                {141212160, 8.8, 12.1},
                                {141220800, 3.9, 12.3},
                                {141229440, 2.7, 18.1},
                                {141238080, 10.2,18.2},
                                {141246720, 9.6, 17.9},
                                {141255360, 9.3, 17.5},
                                {141264000, 8.1, 12.7},
                                {141272640, 6.7, 11.2},
                                {141281280, 4.0, 10.0},
                                {141289920, 6.3, 10.2},
                                {141298560, 6.6, 10.7},
                                {141307200, 6.6, 10.3},
                                {141315840, 5.9, 10.4},
                                {141324480, 1.2, 10.6},
                                {141333120, -0.1, 9.2},
                                {141341760, -1.0, 9.4},
                                {141350400, -1.7, 8.3},
                                {141359040, -0.6, 7.5},
                                {141367680, 6.9, 10.1},
                                {141376320, 7.7, 10.5},
                                {141384960, 3.8,  9.7},
                                {141393600, 6.2,  8.6},
                                {141402240, 6.5,  9.2},
                                {141410880, 7.9, 10.7},
                                {141419520, 6.1, 10.9},
                                {141428160, 10.3,13.1},
                                {141437160, 7.1, 13.3},
                                {141445800, 0.0, 10.1},
                                {141454440, 0.0,  5.7},
                                {141463080, 3.9,  4.6},
                                {141471720, 4.0,  4.8},
                                /* 2014-11-01 */
                                {141480360, 4.8, 11.2},
                                {141489000, 7.0,  8.5},
                                {141497640, 3.0,  9.8},
                                {141506280, 2.8,  5.9},
                                {141514920, 0.8,  4.8},
                                {141523560, -0.2, 2.9},
                                {141532200, -0.6, 5.5},
                                {141540840, 6.6, 10.3},
                                {141549480, 5.4,  7.3},
                                {141558120, 3.0,  8.4},
                                {141566760, 0.4,  3.2},
                                {141575400, -0.1, 6.8},
                                {141584040, 4.8,  8.8},
                                {141592680, 4.6,  8.5},
                                {141601320, 4.3,  7.7},
                                {141609960, 3.3,  7.5},
                                {141618600, -0.4, 3.2},
                                {141627240, 1.9,  4.7},
                                {141635880, -0.2, 3.7},
                                {141644520, -1.3, 2.1},
                                {141653160, -1.8, 0.9},
                                {141661800, -2.7, 1.3},
                                {141670440, 0.3,  2.5},
                                {141679080, 3.4,  6.5},
                                {141687720, 0.8,  6.1},
                                {141696360, -1.0, 1.3},
                                {141705000, 0.4,  3.1},
                                {141713640, -1.2, 1.9},
                                {141722280, -1.1, 2.8},
                                {141730920, -0.7, 1.8},
                                /* 2014-12-01 */
                                {141739560, 0.5,  2.5},
                                {141748200, 1.4,  3.2},
                                {141756840, 4.5, 10.2},
                                {141765480, 0.4, 10.0},
                                {141774120, 2.5,  3.7},
                                {141782760, 1.1,  5.0},
                                {141791400, 2.0,  4.4},
                                {141800040, 1.4,  2.2},
                                {141808680, 0.7,  4.6},
                                {141817320, 1.9,  3.9},
                                {141825960, -0.2, 3.7},
                                {141834600, -0.1, 1.7},
                                {141843240, -1.0, 3.8},
                                {141851880, 0.5,  5.4},
                                {141860520, -1.7, 5.6},
                                {141869160, 0.3,  2.8},
                                {141877800, -3.0, 0.4},
                                {141886440, -1.1, 1.5},
                                {141895080, 0.8,  3.4},
                                {141903720, 0.9,  4.4},
                                {141912360, 0.3,  3.9},
                                {141921000, 0.6,  5.3},
                                {141929640, 1.5,  4.4},
                                {141938280, 0,      0},
                                {141946920, 0,      0},
                                {141955560, 10.6,   4},
                                {141964200, 10.8,   5},
                                {141972840, 8.4,    4},
                                {141981480, 5.2,  2.4},
                                {141990120, 1.3,  2.5},
                                {141998760, 1.6,  4.2}
                        })
                        ,
                });
    }

    public  void InitView(){


        aaChartView.aa_drawChartWithChartModel(configureArearangeChart());
    }

}
